<template>
  <div>
    
    <input type="text" v-model="phone">
    <button @click="res">提交</button>
  </div>
</template>
<script>
import {mapMutations} from "vuex"
export default {
  data(){
    return {
      phone:""
    }
  },
  methods:{
    ...mapMutations(["setuname"]),
    res(){
      this.setuname(this.phone)
      this.$router.push("/test2")
    }
  }
}
</script>